package com.wc.alorithm_blue_bridge._思维.Q4571;

import java.util.Scanner;

/**
 * @Author congege
 * @Description 找零1：找零钱硬币最小值
 * https://www.lanqiao.cn/problems/4571/learning/?page=1&first_category_id=1
 * @Date Created in 2023/12/19-17:15
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int m = sc.nextInt();
        int ans = 0;
        while (m > 0) {
            ans += m % 10;
            m /= 10;
        }
        System.out.println(ans);
    }
}
